-- { echoOn }
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'G'), formatDateTimeInJodaSyntax(datetime64, 'G'), formatDateTimeInJodaSyntax(date, 'G'), formatDateTimeInJodaSyntax(date32, 'G');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'GG'), formatDateTimeInJodaSyntax(datetime64, 'GG'), formatDateTimeInJodaSyntax(date, 'GG'), formatDateTimeInJodaSyntax(date32, 'GG');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'GGG'), formatDateTimeInJodaSyntax(datetime64, 'GGG'), formatDateTimeInJodaSyntax(date, 'GGG'), formatDateTimeInJodaSyntax(date32, 'GGG');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'GGGG'), formatDateTimeInJodaSyntax(datetime64, 'GGGG'), formatDateTimeInJodaSyntax(date, 'GGGG'), formatDateTimeInJodaSyntax(date32, 'GGGG');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'GGGGG'), formatDateTimeInJodaSyntax(datetime64, 'GGGGG'), formatDateTimeInJodaSyntax(date, 'GGGGG'), formatDateTimeInJodaSyntax(date32, 'GGGGG');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'C'), formatDateTimeInJodaSyntax(datetime64, 'C'), formatDateTimeInJodaSyntax(date, 'C'), formatDateTimeInJodaSyntax(date32, 'C');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'CC'), formatDateTimeInJodaSyntax(datetime64, 'CC'), formatDateTimeInJodaSyntax(date, 'CC'), formatDateTimeInJodaSyntax(date32, 'CC');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'CCC'), formatDateTimeInJodaSyntax(datetime64, 'CCC'), formatDateTimeInJodaSyntax(date, 'CCC'), formatDateTimeInJodaSyntax(date32, 'CCC');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'Y'), formatDateTimeInJodaSyntax(datetime64, 'Y'), formatDateTimeInJodaSyntax(date, 'Y'), formatDateTimeInJodaSyntax(date32, 'Y');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'YY'), formatDateTimeInJodaSyntax(datetime64, 'YY'), formatDateTimeInJodaSyntax(date, 'YY'), formatDateTimeInJodaSyntax(date32, 'YY');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'YYY'), formatDateTimeInJodaSyntax(datetime64, 'YYY'), formatDateTimeInJodaSyntax(date, 'YYY'), formatDateTimeInJodaSyntax(date32, 'YYY');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'YYYY'), formatDateTimeInJodaSyntax(datetime64, 'YYYY'), formatDateTimeInJodaSyntax(date, 'YYYY'), formatDateTimeInJodaSyntax(date32, 'YYYY');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'YYYYY'), formatDateTimeInJodaSyntax(datetime64, 'YYYYY'), formatDateTimeInJodaSyntax(date, 'YYYYY'), formatDateTimeInJodaSyntax(date32, 'YYYYY');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'e'), formatDateTimeInJodaSyntax(datetime64, 'e'), formatDateTimeInJodaSyntax(date, 'e'), formatDateTimeInJodaSyntax(date32, 'e');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'ee'), formatDateTimeInJodaSyntax(datetime64, 'ee'), formatDateTimeInJodaSyntax(date, 'ee'), formatDateTimeInJodaSyntax(date32, 'ee');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'E'), formatDateTimeInJodaSyntax(datetime64, 'E'), formatDateTimeInJodaSyntax(date, 'E'), formatDateTimeInJodaSyntax(date32, 'E');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'EE'), formatDateTimeInJodaSyntax(datetime64, 'EE'), formatDateTimeInJodaSyntax(date, 'EE'), formatDateTimeInJodaSyntax(date32, 'EE');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'EEE'), formatDateTimeInJodaSyntax(datetime64, 'EEE'), formatDateTimeInJodaSyntax(date, 'EEE'), formatDateTimeInJodaSyntax(date32, 'EEE');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'EEEE'), formatDateTimeInJodaSyntax(datetime64, 'EEEE'), formatDateTimeInJodaSyntax(date, 'EEEE'), formatDateTimeInJodaSyntax(date32, 'EEEE');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'EEEEE'), formatDateTimeInJodaSyntax(datetime64, 'EEEEE'), formatDateTimeInJodaSyntax(date, 'EEEEE'), formatDateTimeInJodaSyntax(date32, 'EEEEE');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'y'), formatDateTimeInJodaSyntax(datetime64, 'y'), formatDateTimeInJodaSyntax(date, 'y'), formatDateTimeInJodaSyntax(date32, 'y');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'yy'), formatDateTimeInJodaSyntax(datetime64, 'yy'), formatDateTimeInJodaSyntax(date, 'yy'), formatDateTimeInJodaSyntax(date32, 'yy');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'yyy'), formatDateTimeInJodaSyntax(datetime64, 'yyy'), formatDateTimeInJodaSyntax(date, 'yyy'), formatDateTimeInJodaSyntax(date32, 'yyy');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'yyyy'), formatDateTimeInJodaSyntax(datetime64, 'yyyy'), formatDateTimeInJodaSyntax(date, 'yyyy'), formatDateTimeInJodaSyntax(date32, 'yyyy');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'yyyyy'), formatDateTimeInJodaSyntax(datetime64, 'yyyyy'), formatDateTimeInJodaSyntax(date, 'yyyyy'), formatDateTimeInJodaSyntax(date32, 'yyyyy');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'D'), formatDateTimeInJodaSyntax(datetime64, 'D'), formatDateTimeInJodaSyntax(date, 'D'), formatDateTimeInJodaSyntax(date32, 'D');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'DD'), formatDateTimeInJodaSyntax(datetime64, 'DD'), formatDateTimeInJodaSyntax(date, 'DD'), formatDateTimeInJodaSyntax(date32, 'DD');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'DDD'), formatDateTimeInJodaSyntax(datetime64, 'DDD'), formatDateTimeInJodaSyntax(date, 'DDD'), formatDateTimeInJodaSyntax(date32, 'DDD');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'M'), formatDateTimeInJodaSyntax(datetime64, 'M'), formatDateTimeInJodaSyntax(date, 'M'), formatDateTimeInJodaSyntax(date32, 'M');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'MM'), formatDateTimeInJodaSyntax(datetime64, 'MM'), formatDateTimeInJodaSyntax(date, 'MM'), formatDateTimeInJodaSyntax(date32, 'MM');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'MMM'), formatDateTimeInJodaSyntax(datetime64, 'MMM'), formatDateTimeInJodaSyntax(date, 'MMM'), formatDateTimeInJodaSyntax(date32, 'MMM');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'MMMM'), formatDateTimeInJodaSyntax(datetime64, 'MMMM'), formatDateTimeInJodaSyntax(date, 'MMMM'), formatDateTimeInJodaSyntax(date32, 'MMMM');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'd'), formatDateTimeInJodaSyntax(datetime64, 'd'), formatDateTimeInJodaSyntax(date, 'd'), formatDateTimeInJodaSyntax(date32, 'd');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'dd'), formatDateTimeInJodaSyntax(datetime64, 'dd'), formatDateTimeInJodaSyntax(date, 'dd'), formatDateTimeInJodaSyntax(date32, 'dd');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'ddd'), formatDateTimeInJodaSyntax(datetime64, 'ddd'), formatDateTimeInJodaSyntax(date, 'ddd'), formatDateTimeInJodaSyntax(date32, 'ddd');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'a'), formatDateTimeInJodaSyntax(datetime64, 'a'), formatDateTimeInJodaSyntax(date, 'a'), formatDateTimeInJodaSyntax(date32, 'a');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'aa'), formatDateTimeInJodaSyntax(datetime64, 'aa'), formatDateTimeInJodaSyntax(date, 'aa'), formatDateTimeInJodaSyntax(date32, 'aa');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'aaa'), formatDateTimeInJodaSyntax(datetime64, 'aaa'), formatDateTimeInJodaSyntax(date, 'aaa'), formatDateTimeInJodaSyntax(date32, 'aaa');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'K'), formatDateTimeInJodaSyntax(datetime64, 'K'), formatDateTimeInJodaSyntax(date, 'K'), formatDateTimeInJodaSyntax(date32, 'K');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'KK'), formatDateTimeInJodaSyntax(datetime64, 'KK'), formatDateTimeInJodaSyntax(date, 'KK'), formatDateTimeInJodaSyntax(date32, 'KK');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'KKK'), formatDateTimeInJodaSyntax(datetime64, 'KKK'), formatDateTimeInJodaSyntax(date, 'KKK'), formatDateTimeInJodaSyntax(date32, 'KKK');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'h'), formatDateTimeInJodaSyntax(datetime64, 'h'), formatDateTimeInJodaSyntax(date, 'h'), formatDateTimeInJodaSyntax(date32, 'h');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'hh'), formatDateTimeInJodaSyntax(datetime64, 'hh'), formatDateTimeInJodaSyntax(date, 'hh'), formatDateTimeInJodaSyntax(date32, 'hh');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'hhh'), formatDateTimeInJodaSyntax(datetime64, 'hhh'), formatDateTimeInJodaSyntax(date, 'hhh'), formatDateTimeInJodaSyntax(date32, 'hhh');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'H'), formatDateTimeInJodaSyntax(datetime64, 'H'), formatDateTimeInJodaSyntax(date, 'H'), formatDateTimeInJodaSyntax(date32, 'H');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'HH'), formatDateTimeInJodaSyntax(datetime64, 'HH'), formatDateTimeInJodaSyntax(date, 'HH'), formatDateTimeInJodaSyntax(date32, 'HH');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'HHH'), formatDateTimeInJodaSyntax(datetime64, 'HHH'), formatDateTimeInJodaSyntax(date, 'HHH'), formatDateTimeInJodaSyntax(date32, 'HHH');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'k'), formatDateTimeInJodaSyntax(datetime64, 'k'), formatDateTimeInJodaSyntax(date, 'k'), formatDateTimeInJodaSyntax(date32, 'k');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'kk'), formatDateTimeInJodaSyntax(datetime64, 'kk'), formatDateTimeInJodaSyntax(date, 'kk'), formatDateTimeInJodaSyntax(date32, 'kk');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'kkk'), formatDateTimeInJodaSyntax(datetime64, 'kkk'), formatDateTimeInJodaSyntax(date, 'kkk'), formatDateTimeInJodaSyntax(date32, 'kkk');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'm'), formatDateTimeInJodaSyntax(datetime64, 'm'), formatDateTimeInJodaSyntax(date, 'm'), formatDateTimeInJodaSyntax(date32, 'm');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'mm'), formatDateTimeInJodaSyntax(datetime64, 'mm'), formatDateTimeInJodaSyntax(date, 'mm'), formatDateTimeInJodaSyntax(date32, 'mm');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'mmm'), formatDateTimeInJodaSyntax(datetime64, 'mmm'), formatDateTimeInJodaSyntax(date, 'mmm'), formatDateTimeInJodaSyntax(date32, 'mmm');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 's'), formatDateTimeInJodaSyntax(datetime64, 's'), formatDateTimeInJodaSyntax(date, 's'), formatDateTimeInJodaSyntax(date32, 's');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'ss'), formatDateTimeInJodaSyntax(datetime64, 'ss'), formatDateTimeInJodaSyntax(date, 'ss'), formatDateTimeInJodaSyntax(date32, 'ss');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'sss'), formatDateTimeInJodaSyntax(datetime64, 'sss'), formatDateTimeInJodaSyntax(date, 'sss'), formatDateTimeInJodaSyntax(date32, 'sss');

with '2018-01-12 22:33:44' as s, toDateTime(s, 'UTC') as datetime, toDateTime64(s, 6, 'UTC') as datetime64, toDate(s) as date, toDate32(s) as date32 select formatDateTimeInJodaSyntax(datetime, 'zzzz'), formatDateTimeInJodaSyntax(datetime64, 'zzzz');

with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'G123DDD'), formatDateTimeInJodaSyntax(datetime64, 'G123DDD'), formatDateTimeInJodaSyntax(date, 'G123DDD'), formatDateTimeInJodaSyntax(date32, 'G123DDD');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'G\'\'DDD'), formatDateTimeInJodaSyntax(datetime64, 'G\'\'DDD'), formatDateTimeInJodaSyntax(date, 'G\'\'DDD'), formatDateTimeInJodaSyntax(date32, 'G\'\'DDD');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'G\'aaa\'DDD'), formatDateTimeInJodaSyntax(datetime64, 'G\'aaa\'DDD'), formatDateTimeInJodaSyntax(date, 'G\'aaa\'DDD'), formatDateTimeInJodaSyntax(date32, 'G\'aaa\'DDD');
with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'G\'a\'\'aa\'DDD'), formatDateTimeInJodaSyntax(datetime64, 'G\'a\'\'aa\'DDD'), formatDateTimeInJodaSyntax(date, 'G\'a\'\'aa\'DDD'), formatDateTimeInJodaSyntax(date32, 'G\'a\'\'aa\'DDD');

with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'x'), formatDateTimeInJodaSyntax(datetime64, 'x'), formatDateTimeInJodaSyntax(date, 'x'), formatDateTimeInJodaSyntax(date32, 'x');

with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'w'), formatDateTimeInJodaSyntax(datetime64, 'w'), formatDateTimeInJodaSyntax(date, 'w'), formatDateTimeInJodaSyntax(date32, 'w');

with '2018-01-12 22:33:44' as s, toDateTime(s) as datetime, toDateTime64(s, 6) as datetime64, toDate(s) as date, toDate32(s) as date32 SELECT formatDateTimeInJodaSyntax(datetime, 'S'), formatDateTimeInJodaSyntax(datetime64, 'S'), formatDateTimeInJodaSyntax(date, 'S'), formatDateTimeInJodaSyntax(date32, 'S');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'S');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'SS');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'SSS');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'SSSS');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'SSSSS');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'SSSSSS');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'SSSSSSS');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'SSSSSSSS');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'SSSSSSSSS');
with '2018-01-12 22:33:44.55' as s, toDateTime64(s, 6) as datetime64 SELECT formatDateTimeInJodaSyntax(datetime64, 'SSSSSSSSSS');
-- { echoOff }

SELECT formatDateTimeInJodaSyntax(toDateTime('2018-01-12 22:33:44'), 'z'); -- { serverError 48 }
SELECT formatDateTimeInJodaSyntax(toDateTime('2018-01-12 22:33:44'), 'zz'); -- { serverError 48 }
SELECT formatDateTimeInJodaSyntax(toDateTime('2018-01-12 22:33:44'), 'zzz'); -- { serverError 48 }
SELECT formatDateTimeInJodaSyntax(toDateTime('2018-01-12 22:33:44'), 'Z'); -- { serverError 48 }
SELECT formatDateTimeInJodaSyntax(toDateTime('2018-01-12 22:33:44'), 'b'); -- { serverError 48 }

SELECT formatDateTimeInJodaSyntax(toDate32('2018-01-12 22:33:44'), 'z'); -- { serverError 48 }
SELECT formatDateTimeInJodaSyntax(toDate32('2018-01-12 22:33:44'), 'zz'); -- { serverError 48 }
SELECT formatDateTimeInJodaSyntax(toDate32('2018-01-12 22:33:44'), 'zzz'); -- { serverError 48 }
SELECT formatDateTimeInJodaSyntax(toDate32('2018-01-12 22:33:44'), 'Z'); -- { serverError 48 }
SELECT formatDateTimeInJodaSyntax(toDate32('2018-01-12 22:33:44'), 'b'); -- { serverError 48 }

SELECT formatDateTimeInJodaSyntax(toDate32('2018-01-12 22:33:44'), '\'aaaa\'\''); -- { serverError 36 }
